from rest_framework import serializers
from .models import *


class TeacherSer(serializers.ModelSerializer):
    class Meta:
        model = Teacher
        fields = '__all__'


class StudentSer(serializers.ModelSerializer):
    class Meta:
        model = Student
        fields = '__all__'


class StudentsSer(serializers.ModelSerializer):
    teacher = serializers.CharField(source='teacher.name')

    class Meta:
        model = Student
        fields = '__all__'
